<div class="container">

    <form method="post" action="<?=base_url('attributes_to_object/set_default')?>">

        <div class="page-header">

            <div class="row">

                <h1 class="span8">View attributes</h1>

                <span class="span4" style="padding-top: 40px;">
                    <select name="object_type" id="object_type">
                        <option value="apartment" <?if($_GET['object_type']=='apartment')echo 'selected="selected"';?>>Apartment</option>
                        <option value="hotel" <?if($_GET['object_type']=='hotel')echo 'selected="selected"';?>>Hotel</option>
                        <option value="villa" <?if($_GET['object_type']=='villa')echo 'selected="selected"';?>>Villa</option>
                    </select>
                    <select name="group_ID" id="group_ID">
                        <option value="1" <?if($_GET['group_ID']==1)echo 'selected="selected"';?>>General</option>
                        <option value="2" <?if($_GET['group_ID']==2)echo 'selected="selected"';?>>Meals</option>
                        <option value="3" <?if($_GET['group_ID']==3)echo 'selected="selected"';?>>Beaches</option>
                        <option value="4" <?if($_GET['group_ID']==4)echo 'selected="selected"';?>>Distance from</option>
                        <option value="5" <?if($_GET['group_ID']==5)echo 'selected="selected"';?>>Additional activities neraby</option>
                        <option value="6" <?if($_GET['group_ID']==6)echo 'selected="selected"';?>>Hotel equipment and offering</option>
                        <option value="7" <?if($_GET['group_ID']==7)echo 'selected="selected"';?>>All accommodation units are equiped with</option>
                        <option value="8" <?if($_GET['group_ID']==8)echo 'selected="selected"';?>>Location</option>
                        <option value="9" <?if($_GET['group_ID']==9)echo 'selected="selected"';?>>Object description</option>
                    </select>
                    
                    <a href="javascript:" id="load_attributes">Load attributes</a>
                </span>

            </div>

        </div>

        <div class="row">

            <div class="span12">

                <div class="demo_jui">

                    <table class="table table-striped table-bordered table-condensed">
                        <thead>
                            <tr>
                                <th></th>
                                <th>Attribute Code</th>
                                <th>Attribute Name</th>
                                <th>Attribute Type</th>
                                <th class="th-action center">Action</th>
                            </tr>
                        </thead>
                        <tbody>

                            <?  foreach($attributes as $attribute): ?> 

                                <tr>
                                    <td><input type="checkbox" name="attributes[]" value="<?=$attribute['ID']?>" <? if(in_array($attribute['ID'], $object_attributes)) echo 'checked="checked"'; ?>></td>
                                    <td><?=$attribute['ID']?></td>
                                    <td><strong><?=$attribute['name']?></strong></td>
                                    <td><?=$attribute['value']?></td>
                                    <td class="center">
                                        <a href="<?=base_url()?>attributes/delete/<?=$attribute['ID']?>" rel="<?=$attribute['ID']?>" class="delete_post">Delete</a>
                                    </td> 

                                </tr>                                      

                                <? endforeach; ?>

                        </tbody>
                    </table>



                </div>

            </div>

        </div>

        <input type="submit" value="set default">
        
    </form>

</div>